package com.ladlee.parking.pay.v3.enums;

import cn.hutool.core.util.ObjectUtil;

/**
 * 支付方式:目前支持微信和支付宝
 */
public enum PayType {

    ALIPAY("ALIPAY", "支付宝"),
    WECHAT("WEIXIN", "微信");

    private String type;

    private String typeName;

    PayType(String type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public static Boolean validation(String type) {
        for (PayType value : PayType.values()) {
            if (ObjectUtil.equal(value.getType(), type)) {
                return true;
            }
        }
        return false;
    }
}
